package cn.zswltech.gruul.common.dal.dao;

import cn.zswltech.gruul.common.dal.tkmybatis.IMapper;
import cn.zswltech.gruul.common.entity.OrgDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface OrgDOMapper extends IMapper<OrgDO> {
    List<OrgDO> queryAll();

    List<OrgDO> queryBysSystemCode(@Param("systemCode") String systemCode);

    OrgDO queryByPrimaryKey(Long id);

    OrgDO queryByCode(String orgCode);

    List<OrgDO> queryByName(@Param("name") String name, @Param("type") Integer type);

    @Override
    int insert(OrgDO org);

    List<OrgDO> queryByParentId(Long id);

    List<OrgDO> selectByIds(@Param("ids") List<Long> ids, @Param("type") Integer type);

    void updatePidAndLevel(@Param("orgDOList") List<OrgDO> orgDOList);

    /**
     * 批量新增
     * @param orgDOList
     */
    void batchInser(List<OrgDO> orgDOList);
}